Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow casks to opt-in to forcibly quit during brew upgrade #17247

Open
1 task done
setchy opened this issue May 7, 2024 · 9 comments
Open
1 task done

Allow casks to opt-in to forcibly quit during brew upgrade #17247

setchy opened this issue May 7, 2024 · 9 comments
Labels
cask Homebrew Cask features New features help wanted We want help addressing this

Comments

@setchy
Copy link

setchy commented May 7, 2024

Verification

Provide a detailed description of the proposed feature

Currently when performing brew upgrade, the quit stanza is skipped.

This FR is to add the ability for cask maintainers to opt-in to forcibly quit before upgrading their apps.

What is the motivation for the feature?

Based on feedback from @bevanjkay on Homebrew/homebrew-cask#173061

In the instance of Gitify, users experience errors/exceptions when the application is upgraded in-place without exiting it first

How will the feature be relevant to at least 90% of Homebrew users?

to be discussed

What alternatives to the feature have been considered?

Adding custom preflight and postflight scripts to individual casks

@MikeMcQuaid
Copy link
Member

Seems reasonable to me but defer to @Homebrew/cask folks.

@bevanjkay
Copy link
Member

bevanjkay commented May 7, 2024

skipping these stanzas (uninstall quit, and uninstall signal) was a recent change, because apps such as Visual Studio Code should not be forcibly closed as it is likely to cause a loss of work. And we were seeing an increase in PRs to add the stanzas.

Adding the ability to specify that the stanza should fire on upgrade makes sense to me, but the criteria for when this should apply could be difficult to determine. I would suggest that the loss of work is the item that matters most.

@MikeMcQuaid
Copy link
Member

Adding the ability to specify that the stanza should fire on upgrade makes sense to me, but the criteria for when this should apply could be difficult to determine.

Opt-in with a new DSL makes sense to me here.

What happens on uninstall?

@bevanjkay
Copy link
Member

bevanjkay commented May 7, 2024

On uninstall we do run the quit and signal directives, but not on upgrade or reinstall.

@MikeMcQuaid
Copy link
Member

@bevanjkay Gotcha. Could you dig up the PR that changed this, too?

@bevanjkay
Copy link
Member

Here's the related PR: #16507

@MikeMcQuaid
Copy link
Member

Thanks @bevanjkay. Yeh, I think a new DSL/parameter is warranted here.

@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label May 8, 2024
@bevanjkay
Copy link
Member

Can you think of an existing dsl that has a similar parameter I can use as a guide?

@MikeMcQuaid
Copy link
Member

@bevanjkay depends_on I think is the best model here? It may be more complicated than you need, though. Feel free to hack something together and open a very early draft WIP PR and I'll help you from there 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cask Homebrew Cask features New features help wanted We want help addressing this
Projects
None yet
Development

No branches or pull requests

4 participants